UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ws8Tt/VndVLP/T/nKXw5cCL32XUmc1II0zLGTHOUH6E=' 
WHERE 
  key_id = 'ee94a2274db06365d9a232dc305582326840900d2cbcc21a4dad5cc7853048b9' 
  AND (
    token = 'ws8Tt/VndVLP/T/nKXw5cCL32XUmc1II0zLGTHOUH6E=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025