UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'H85iO1oSSwF9R9y3Qw8x4EchOs0JS7sNaTx9zOlGMO8=' 
WHERE 
  key_id = 'd0379b17d596ec75056f57d6ad765d34c9bbf608c6b222607ce69f2c385b140b' 
  AND (
    token = 'H85iO1oSSwF9R9y3Qw8x4EchOs0JS7sNaTx9zOlGMO8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027