UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'PbJx/InAsWLWR5mMkPzX4lrLWgZCOdLoAFNU5gk4uPU=' 
WHERE 
  key_id = '6daf2b4e3739d6ea03e52800d0c49ac3997ff09242737ee0773999884441d4cd' 
  AND (
    token = 'PbJx/InAsWLWR5mMkPzX4lrLWgZCOdLoAFNU5gk4uPU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00049