UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'VT169N3qds4Q+RhBTTU5VRI0wA0/j4yHYBdHUFsl9RM=' 
WHERE 
  key_id = '7141f547acedf8be774ddc1fe418f1e50e37551cd9d6c0f3ff880d276ff2a596' 
  AND (
    token = 'VT169N3qds4Q+RhBTTU5VRI0wA0/j4yHYBdHUFsl9RM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029