UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'nLwCzTJ5Rs9THjzBTne+j5ZOXbiWYFOT89kftjXmH4g=' 
WHERE 
  key_id = '01f2fbe025731287102eaf5961de41c75228cbd677557f358d955a4f5cc70eec' 
  AND (
    token = 'nLwCzTJ5Rs9THjzBTne+j5ZOXbiWYFOT89kftjXmH4g=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030