UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LkNGSSIo4RxCByYMVd2VnJmt2uifcTuUTcf6Lp1BaEo=' 
WHERE 
  key_id = '8eb1f912701dae1dd0a6b157f4c0b9821264cf34ef54c9db05fad02ee1650ef5' 
  AND (
    token = 'LkNGSSIo4RxCByYMVd2VnJmt2uifcTuUTcf6Lp1BaEo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034