UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '8Ml06m4ngGqgtIfbFVL4lBYFobUqofOjpheIxHWfvWs=' 
WHERE 
  key_id = '187380eb4337717c7d1e4ffd2b43d94285199a88979f94a31784c663a2b47706' 
  AND (
    token = '8Ml06m4ngGqgtIfbFVL4lBYFobUqofOjpheIxHWfvWs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023