UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'EWKw/5QNFzjk8ymqpp1Ybe3A6KlmWDfAUqed5ewrVsc=' 
WHERE 
  key_id = '26c71d55120ec76fd5d67a07955474f75061c9873f7e10b6ec28bf6426cf2a4c' 
  AND (
    token = 'EWKw/5QNFzjk8ymqpp1Ybe3A6KlmWDfAUqed5ewrVsc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026