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

Query time 0.00028