UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0w+jVVYJpZdg1uRDrmwWzXCWoLmID81bsRIdSQ/QY4w=' 
WHERE 
  key_id = '1558da7d90b5c6840185cb0bb4ed014f0d640ad47d1c5a975544ffb78679ac06' 
  AND (
    token = '0w+jVVYJpZdg1uRDrmwWzXCWoLmID81bsRIdSQ/QY4w=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028