UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'GPf+WYCBDeltgAYQnHKaTbgxuCgpI1vFPhiMWxq7B1M=' 
WHERE 
  key_id = 'fb86744da8b20c2794ee15ce616e6244d7a4b9002a69dab7378ffedda0c4d124' 
  AND (
    token = 'GPf+WYCBDeltgAYQnHKaTbgxuCgpI1vFPhiMWxq7B1M=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038