UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'NADGrDK1Q6Fxiifa2xXNFzBiikHftMqfbQZy+czPGfw=' 
WHERE 
  key_id = '3e87609d95ac70d71c8b881d2b3e89a1c6a7ad41ddc74251c8f9d686011b561c' 
  AND (
    token = 'NADGrDK1Q6Fxiifa2xXNFzBiikHftMqfbQZy+czPGfw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041