UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zc3UnkAOXdf9LolvhhLJrIMMKe3jDuWmjOjg858tflk=' 
WHERE 
  key_id = 'b1f5ed0a79fcf962852a0e058554f9caec32fc828bc0ba03c0247e1817dc3245' 
  AND (
    token = 'zc3UnkAOXdf9LolvhhLJrIMMKe3jDuWmjOjg858tflk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042