UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'QGpNKfQVj5jfACkkUe7aTkz12IwHiNtvAcBuj0yi2MQ=' 
WHERE 
  key_id = 'fbb29c2b3e82da0f10f557464dd90c12dfdf170f4208fe7014e921dae1831e2b' 
  AND (
    token = 'QGpNKfQVj5jfACkkUe7aTkz12IwHiNtvAcBuj0yi2MQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020