UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'n/ifjEXEZWZN3Io1rpGVu1IyqJCzN+e7ejbESiYdyjo=' 
WHERE 
  key_id = '89d6801f210e42e25fb5a9e70ae4f393bca2d4945cd0a028e9324e80fff70694' 
  AND (
    token = 'n/ifjEXEZWZN3Io1rpGVu1IyqJCzN+e7ejbESiYdyjo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016