UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6k1U6QOJsOEppehjzrb2O3v8bEuwp4NN0h/R6mO2NZ8=' 
WHERE 
  key_id = 'be7e359f5a04fed8ea3ec9185852ede3b98c0aa8ef271364eee5ce9ef4a68353' 
  AND (
    token = '6k1U6QOJsOEppehjzrb2O3v8bEuwp4NN0h/R6mO2NZ8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00049