UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'RWq5RJllBVoNmfq8/0f0nT/IIxgUibJ4ra88mhMxq9M=' 
WHERE 
  key_id = 'bd36be7d647680e8f361a64b2af24be5b0597c844f04735c30c153c6d027ac06' 
  AND (
    token = 'RWq5RJllBVoNmfq8/0f0nT/IIxgUibJ4ra88mhMxq9M=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028