UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'hH/vKfuD/v0PiY0Bop5i/i8aLCgamgGwqxqrFVZORsY=' 
WHERE 
  key_id = '8cdc4f99d57815ef4227c5146130af96e83cf03a6ee6a798454d15718966bd8e' 
  AND (
    token = 'hH/vKfuD/v0PiY0Bop5i/i8aLCgamgGwqxqrFVZORsY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028