UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'sWuvBMnwepgh6JeNPQq0FGo6T/vCZ79/F34OVx8/cAQ=' 
WHERE 
  key_id = 'c4f00a3cc65d11688d2ea49f10e71c50ccd98b2cff90fa495c42d0d370647b60' 
  AND (
    token = 'sWuvBMnwepgh6JeNPQq0FGo6T/vCZ79/F34OVx8/cAQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029