UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ah4V0hEyv3bHmnpHcJGIEtdWzy7/CJ/SAAkLVR9GXkU=' 
WHERE 
  key_id = 'b9246e4a6239ac0e2fe430f73382e94efc37c9db429c8a9674ee2448fd55971c' 
  AND (
    token = 'ah4V0hEyv3bHmnpHcJGIEtdWzy7/CJ/SAAkLVR9GXkU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022