UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9wxqPkjpJY/aNnIl8AEox9RkZs+Iwmc4el2pdehg7WM=' 
WHERE 
  key_id = '5cfab8463b7d2bc0aa8fdcd4f2883f196f2a0639c772b0dece80184045f79ddf' 
  AND (
    token = '9wxqPkjpJY/aNnIl8AEox9RkZs+Iwmc4el2pdehg7WM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024