UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3SJN3YRclAJrHoidMkaue4l+HDHNzXZ9/SEvFXL4vzs=' 
WHERE 
  key_id = '756fc44b57ef75a9b9f3704d53a574c3f8bd66cfeb617d86438fefa4d38fdafa' 
  AND (
    token = '3SJN3YRclAJrHoidMkaue4l+HDHNzXZ9/SEvFXL4vzs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031