UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6t8TWcOR9VMPMGS80y/Mq1HTPwKPCax36/5MFrzhl98=' 
WHERE 
  key_id = '69fbe74039278d2b4e72a04bed74c3d46f7b1dcba163f5dc93680fdcdea49e51' 
  AND (
    token = '6t8TWcOR9VMPMGS80y/Mq1HTPwKPCax36/5MFrzhl98=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039