UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'rVoN37Nlhixb/vhOTDkIycDRK5AAW23b9f61d+qy/Lw=' 
WHERE 
  key_id = 'cbee38f4ebd8c247f6906ae1c9cf254ea08c0104e4b804da393af6e807ba917a' 
  AND (
    token = 'rVoN37Nlhixb/vhOTDkIycDRK5AAW23b9f61d+qy/Lw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00048