UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'x9ndcLS3doenftegYFelwTddisEZAXE/O+zl4l4P690=' 
WHERE 
  key_id = 'a1ca3fb69a58be21b6f7e1d87b7389e59171faaae29b678863797eeb210b93bc' 
  AND (
    token = 'x9ndcLS3doenftegYFelwTddisEZAXE/O+zl4l4P690=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020