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

Query time 0.00032