UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Hqwnoufd5xBHH3Km4jNb0DRoKZ89Z8OhQ4KiVsDXlzE=' 
WHERE 
  key_id = '07abdfd23abf3450d0241dc2e7f4dd4de413034638a0268ffdd4fbac346982b3' 
  AND (
    token = 'Hqwnoufd5xBHH3Km4jNb0DRoKZ89Z8OhQ4KiVsDXlzE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019