UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'iz7nmPwS2UIbbniAwOwpV9+APO5wulZ8fvFh5VEduqk=' 
WHERE 
  key_id = 'a337ba44faf69ea1b5735294eadfaeffa4cbb624fb3980f2bd3ef1fde42aaac3' 
  AND (
    token = 'iz7nmPwS2UIbbniAwOwpV9+APO5wulZ8fvFh5VEduqk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028