UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UARnyu04X2+o24RUdFyUMociv1xzDOADkmMd9rvRG/o=' 
WHERE 
  key_id = 'decee903e89c8dfbcfe280f778ae22495f464576e6c4f17e38e97692ccffbf5f' 
  AND (
    token = 'UARnyu04X2+o24RUdFyUMociv1xzDOADkmMd9rvRG/o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044