UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '8/6sJiLW9yyW60bsInoMn0i/y2kiqws9pBSMfp9tIyw=' 
WHERE 
  key_id = '2d135e0f1ab2a6ae056c6e66336c5c1cb6abce65802e566b2bf28fc5c88ba46c' 
  AND (
    token = '8/6sJiLW9yyW60bsInoMn0i/y2kiqws9pBSMfp9tIyw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027