UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'XzY3+e4+IWTTl/2SaWmJunxfJMLWYASMlQ5MxUaY+XA=' 
WHERE 
  key_id = '59b145693a06c31b91a6b6a7ebc6eaf7f91931e58ba2b01ce88b78963a310f8e' 
  AND (
    token = 'XzY3+e4+IWTTl/2SaWmJunxfJMLWYASMlQ5MxUaY+XA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033