UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'SCNxydegngrTCoR1+Ia5+YiAZGYgAk3Og6Ru8qcMHt4=' 
WHERE 
  key_id = '83b71da8cf4bdbb2d99864f78c75220bfcdcfd72a2c09f7f4fe18077094d583e' 
  AND (
    token = 'SCNxydegngrTCoR1+Ia5+YiAZGYgAk3Og6Ru8qcMHt4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016